/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package enterprise.ent;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author JAVIER
 */
@Entity
@Table(name = "usuarios")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Usuarios.findAll", query = "SELECT u FROM Usuarios u"),
    @NamedQuery(name = "Usuarios.findByIdUsuario", query = "SELECT u FROM Usuarios u WHERE u.idUsuario = :idUsuario"),
    @NamedQuery(name = "Usuarios.findByUserUser", query = "SELECT u FROM Usuarios u WHERE u.userUser = :userUser"),
    @NamedQuery(name = "Usuarios.findByUserPass", query = "SELECT u FROM Usuarios u WHERE u.userPass = :userPass"),
    @NamedQuery(name = "Usuarios.findByUserEmail", query = "SELECT u FROM Usuarios u WHERE u.userEmail = :userEmail"),
    @NamedQuery(name = "Usuarios.findByUserGenero", query = "SELECT u FROM Usuarios u WHERE u.userGenero = :userGenero"),
    @NamedQuery(name = "Usuarios.findByUserLastlogin", query = "SELECT u FROM Usuarios u WHERE u.userLastlogin = :userLastlogin"),
    @NamedQuery(name = "Usuarios.findByUserFecalta", query = "SELECT u FROM Usuarios u WHERE u.userFecalta = :userFecalta"),
    @NamedQuery(name = "Usuarios.findByUserFoto", query = "SELECT u FROM Usuarios u WHERE u.userFoto = :userFoto")})
public class Usuarios implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_usuario")
    private Long idUsuario;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 16)
    @Column(name = "user_user")
    private String userUser;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "user_pass")
    private String userPass;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 60)
    @Column(name = "user_email")
    private String userEmail;
    @Size(max = 2)
    @Column(name = "user_genero")
    private String userGenero;
    @Column(name = "user_lastlogin")
    @Temporal(TemporalType.DATE)
    private Date userLastlogin;
    @Basic(optional = false)
    @NotNull
    @Column(name = "user_fecalta")
    @Temporal(TemporalType.TIMESTAMP)
    private Date userFecalta;
    @Size(max = 100)
    @Column(name = "user_foto")
    private String userFoto;

    public Usuarios() {
    }

    public Usuarios(Long idUsuario) {
        this.idUsuario = idUsuario;
    }

    public Usuarios(Long idUsuario, String userUser, String userPass, String userEmail, Date userFecalta) {
        this.idUsuario = idUsuario;
        this.userUser = userUser;
        this.userPass = userPass;
        this.userEmail = userEmail;
        this.userFecalta = userFecalta;
    }

    public Long getIdUsuario() {
        return idUsuario;
    }

    public void setIdUsuario(Long idUsuario) {
        this.idUsuario = idUsuario;
    }

    public String getUserUser() {
        return userUser;
    }

    public void setUserUser(String userUser) {
        this.userUser = userUser;
    }

    public String getUserPass() {
        return userPass;
    }

    public void setUserPass(String userPass) {
        this.userPass = userPass;
    }

    public String getUserEmail() {
        return userEmail;
    }

    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail;
    }

    public String getUserGenero() {
        return userGenero;
    }

    public void setUserGenero(String userGenero) {
        this.userGenero = userGenero;
    }

    public Date getUserLastlogin() {
        return userLastlogin;
    }

    public void setUserLastlogin(Date userLastlogin) {
        this.userLastlogin = userLastlogin;
    }

    public Date getUserFecalta() {
        return userFecalta;
    }

    public void setUserFecalta(Date userFecalta) {
        this.userFecalta = userFecalta;
    }

    public String getUserFoto() {
        return userFoto;
    }

    public void setUserFoto(String userFoto) {
        this.userFoto = userFoto;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idUsuario != null ? idUsuario.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Usuarios)) {
            return false;
        }
        Usuarios other = (Usuarios) object;
        if ((this.idUsuario == null && other.idUsuario != null) || (this.idUsuario != null && !this.idUsuario.equals(other.idUsuario))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "enterprise.ent.Usuarios[ idUsuario=" + idUsuario + " ]";
    }
    
}
